accessibility
Macromedia Logo Upper Navigation Bar
 Help
Lower Navigation Bar
ProductsSupportDesigner DeveloperDownloadsStoreInternationalSite MapCompany
Home > Products > UltraDev > Support > TechNote Index
Macromedia Dreamweaver UltraDev Support Center - TechNote

How to put a search and results page set on the same page

Product: UltraDev
Platform: All
Versions: all
ID: 15906
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

A common question among UltraDev developers is how to create a search page where the results of the search are displayed on the search page instead of on another page. While there are many different ways of implementing a search with the results on the same page, this TechNote discusses one possible solution using ASP.

How to setup the search/results page:
1

Create a search page that includes a form and the necessary form elements. In the Property inspector, set the form method to GET and enter the filename of the search page into the action field (e.g.: search.asp). Here is how the HTML code should look:

<form method="get" action="search.asp">
2

Create a Recordset by choosing Window > Data Bindings > click on the plus (+) button > Recordset (Query).

3 Select the Simple view of the Recordset dialog box. In the filter section's first drop down menu, select the column name from the table used as the search criteria. The next drop down menu should be set to equals (=) and the third drop down menu should be set to "URL Parameter". The last box should be the variable ("fn") from your search.asp page, where "fn" is the name of the text field (<input type="text" name="fn">). See the screen shot below for reference:
 
4

Switch the Recordset view from Simple to Advanced. In the Variables section, enter the word "blank" as the Default Value and click the OK button to close the Recordset dialog box. See the screen shot below for reference:

 
 

Note: The word "blank" is arbitrary. The word "blank" was chosen in this example so that no records will be displayed in the results section when the page loads initially with the default value.

5 Create a table on your search.asp page. Open the recordset by choosing Window > Data Bindings > click the plus (+) icon next to the Recordset (Query) to expand the recordset. Drag the recordset fields into the appropriate table cells.
6 Click anywhere in the table and choose the <table> tag from the UltraDev tag selector. Open the Server Behaviors panel and apply the Show Region > Show Region If Recordset Is Not Empty (UltraDev 4) server behavior. If you are using UltraDev 1, use Hide Region > If Recordset is Empty.
7 Save the search.asp page, upload it to the remote site and test it in a Web browser.

Note: The Show Region (Hide Region in UltraDev 1) server behavior is used to hide the results table until the user has entered a value in the search form.

Additional information
For more details on search/results page sets, please refer to Defining a filtered recordset, Building a simple database search feature and Building a multiple-parameter search feature.

For troubleshooting tips related to search/results page sets, please refer to Search/results page set always returns the same record (TechNote 15761).

Last updated: February 15, 2002
Keywords: search results on same page, search/results, Hide Region, Show Region
Created: October 5, 2001

©1995-2002 Macromedia, Inc. All rights reserved.
Accessibility | Privacy policy | Contact us | Site Map